<?php
defined( '_AppBackMiage' ) or die( 'Restricted access' );
if(isAdministrateur ()){
    include_once (DS."backoffice/include/header.php");
    ?>
    <div id="wrapper">
        <div id="content">
            <div id="rightnow">
                <h3 class="reallynow">
                    <span>Liste des modeles de mail</span>
                    <a href="<?php echo URL; ?>index.php?m=admin_mails_add" class="add">Ajouter</a>
                    <br />
                </h3>
                <p class="youhave">
                    <?php
                    $lst = ModelMail::getList();
                    if(!empty($lst))
                    {
                    ?>
                    <table width="100%">
                        <thead>
                            <tr>
                                <th>Nom du patron</th>
                                <th width="150px">Action</th>
                            </tr>
                        </thead>
                        <tbody>
                        <?php
                        foreach($lst as $m)
                        {
                            ?>
                            <tr>
                                <td><?php echo $m->NomModelMail; ?></td>
                                <td><a href="<?php echo URL; ?>index.php?m=admin_mails_edit&id=<?php echo $m->IdModelMail; ?>">Editer</a> - <a href="<?php echo URL; ?>index.php?m=admin_mails_test&id=<?php echo $m->IdModelMail; ?>">Tester</a></td>
                            </tr>
                            <?php
                        }
                        ?>
                    </table>
                    <?php
                    }
                    else
                    {
                        ?><div class="notice">Aucun modele mail n'est d&eacute;fini</div><?php
                    }
                    ?>
                </p>
            </div>
        </div>
    <?php
    include_once (DS."backoffice/include/sidebar.php");
    include_once (DS."backoffice/include/footer.php");
}
else
{
    redirectTo(URLBACK);
}
?>